<?php
/**
 * @package		Joomla.Site
 * @subpackage	mod_articles_latest
 * @copyright	Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
 * @license		GNU General Public License version 2 or later; see LICENSE.txt
 */

// no direct access
defined('_JEXEC') or die;
?>

<?php
		
				$arr2 = preg_split('/<(IMG|img) /', $list[0]->introtext);
	
	
				//if(sizeof($arr2) <= 1) return '';
			    
			    
				$arr3 = preg_split('/src=\"/', $arr2[1]);
			    
			    
				//if(sizeof($arr3) <= 1) return '';
			    
				$arr4 = preg_split('/\"/', $arr3[1]);
			    
			    
			    
				if(preg_match('/http:/', $arr4[0]))
				{
				    $result = $arr4[0];
				}
				else if(preg_match('/^\//', $arr4[0])){
				    $result = $u2 . substr($arr4[0],1);
				}
				else
				{
				    for($ei = 3; $ei < sizeof($u1) - 1; $ei++)
				    {
					$u2 .= $u1[$ei] . "/";
				    }
				    $result = $u2 . $arr4[0];
				}
				if($result == "") $result = JURI::base()."/templates/kdtt/images/noimage100.gif";
		      ?>
	
					


	
<?php foreach ($list as $item) :  ?>			
<div class="service <?php echo $moduleclass_sfx; ?>">
	<div class="frame"><img src="<?php echo $result; ?>" alt="<?php echo $item->title; ?>" title="<?php echo $item->title; ?>"  class="" width="279" height="110" /></div>
	<h2><a href="<?php echo $item->link; ?>" title="<?php echo $item->title; ?>"><?php echo $item->title; ?></a></h2>
	<p>
				<?php
					$arr = explode(" ", strip_tags($item->introtext));
					if(count($arr) >= 50)
					{
						for($i=0; $i < 50; $i++)
						{
							echo $arr[$i]." ";
						}
						echo "...";
					}
					else echo strip_tags($item->introtext);
				
				?>
	</p>		
<a href="<?php echo $item->link; ?>" class="readmore">Đọc thêm</a>				

</div>
<?php endforeach; ?>


